<?php $poster = $item -> getParent(); ?>
<!-- header block -->
<div class="followBlock">
	<div class="clearfix">
		<div class="lfloat">
			<h1><a href="<?php echo $item -> getUrl(); ?>"><?php echo $item -> getTitle(); ?></a></h1>
			<div>
				<span class="poster"><?php echo $poster -> toCardhoverLink(); ?></span>
				<span class="middot">&middot;</span>
				<abbr class="timestamp"><?php echo Intl::getTimeDiff($item -> created_at); ?></abbr>
			</div>
		</div>
		<div class="rfloat">
			<span class="uiButtonGroup brs">
				<a class="uiButtonGroupItem uiButton firstItem" href="" aria-click="button">
					<i class="uiIcon uiIconFav">&nbsp;</i>
					<span class="uiButtonText">Favourite</span>
				</a>
				<span class="uiButtonGroupItem uiButton">
					<div class="uiToggleWrapper">
						<a href="" aria-click="toggle" class="uiSelectorButton">
							<i class="uiIcon uiIconSetting2">&nbsp;</i>
						</a>
						<div class="uiToggleFlyout">
							<div class="uiMenu uiSelectorMenu">
								<ul class="uiMenuInner">
									<li class="uiMenuItem">
										<a class="itemAnchor" href="<?php echo Nuo::getUrl('poll/edit', array('poll_id' => $item -> getId())); ?>">
											<i class="uiIcon uiIconEdit">&nbsp;</i>
											<span class="uiButtonText">Edit</span>
										</a>
									</li>
									<li class="uiMenuItem">
										<a class="itemAnchor" href="<?php echo Nuo::getUrl('poll/delete', array('poll_id' => $item -> getId())); ?>">
											<i class="uiIcon uiIconDelete">&nbsp;</i>
											<span class="uiButtonText">Delete</span>
										</a>
									</li>
								</ul>
							</div>
							
						</div>
					</div>
				</span>
			</span>
		</div>
	</div>
</div>

<div class="clearfix">
	<div class="hbr"></div>
</div>
<div id="visualization" width="300" heigh="200"></div>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
	google.load('visualization', '1', {packages: ['corechart']});
  	function drawVisualization() {
    // Create and populate the data table.
	    var data = google.visualization.arrayToDataTable([
	      ['Task', 'Hours per Day'],
	      ['Work', 11],
	      ['Eat', 2],
	      ['Commute', 2],
	      ['Watch TV', 2],
	      ['Sleep', 7]
	    ]);
    // Create and draw the visualization.
    new google.visualization.PieChart(document.getElementById('visualization')).
        draw(data, {title: "<?php echo $item->getTitle();?>".toUpperCase()});
      }
      google.setOnLoadCallback(drawVisualization);
   </script>
<!-- content block -->
<div class="followBlock">
	<div class="clearfix">
		<form action="<?php echo Nuo::getUrl('poll/vote'); ?>" method="post">
		
		<div><a class="pollTitle"><?php echo $item -> getTitle(); ?></a></div>
		<ol class="pollList">
			<?php foreach($item->getAnswers() as $answer): ?>
			<li class="pollItem">
				<label for="<?php echo $id = $answer -> getHtmlId(); ?>">
					<input id="<?php echo $id?>" type="radio" name="answer[]" value="<?php echo $answer -> getId(); ?>"/><?php echo $answer -> getTitle(); ?>
				</label>
			</li>
			<?php endforeach; ?>
			<li class="pollControl">
				<button class="button submit" type="submit">Submit</submit>
			</li>
		</ol>
		<input type="hidden" name="poll_id" value="<?php echo $item -> getId(); ?>" />
		<input type="hidden" name="max_answer" value="<?php echo $item -> max_answer; ?>" />
		</form>
	</div>
</div>
<!-- activity block -->
<div class="followBlock">
	<div class="clearfix">
		<?php echo $this->renderWidget('activity/widget/browse/activity/item', array('item' => $item)); ?>
	</div>
</div>
